package com.renbang.utils.messgedigest;


/** 
 *  
 * @author 梁栋 
 * @version 1.0 
 * @since 1.0 
 */  
public class DESCoderTest {  
	
	public static void main(String[] args) throws Exception {
		 test() ;
	}
    public static void test() throws Exception {  
        String inputStr = "123";  
        String key = DESCoder.initKey();  //初始化密匙
        System.err.println("原文:\t" + inputStr);  
        System.err.println("密钥:\t" + key);  
////        String mishi = "5Zhu00XBkW4=";
////        String miwen = "1mnde7M1MjU=";//base64
//        
//      byte[] inputData = Coder.decryptBASE64(inputStr);  
        byte[] inputData = inputStr.getBytes();
        inputData = DESCoder.encrypt(inputData, key);  //加密
        System.err.println("加密后:\t" + DESCoder.encryptBASE64(inputData));  

        byte[] outputData = DESCoder.decrypt(inputData, key);  //解密
        String outputStr = new String(outputData);  

        System.err.println("解密后:\t" + outputStr);  

//        assertEquals(inputStr, outputStr);  
    	
    }  
}  